<template>
  <div class="dashboard-container">
    <div class="app-container">
      <el-card shadow="never">
        <el-table :data="tableData" border style="width: 100%;text-align:center" :header-cell-style="headStyle">
          <el-table-column type="index" label="序号" width="70">
          </el-table-column>
          <el-table-column prop="name" label="企业名称" width="280">
          </el-table-column>
          <el-table-column prop="version" label="当前版本" width="100">
          </el-table-column>
          <el-table-column prop="managerId" label="联系人" width="90">
          </el-table-column>
          <el-table-column prop="companyPhone" label="联系电话" width="120">
          </el-table-column>
          <el-table-column prop="expirationDate" label="续费时间" width="120">
          </el-table-column>
          <el-table-column prop="renewalDate" label="到期时间" width="120">
          </el-table-column>
          <el-table-column prop="state" label="状态" width="120">
            <template slot-scope="scope">
            <el-switch
              v-model="scope.row.state"
              :inactive-value="0"
              :active-value="1"
              disabled
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
            </template>
          </el-table-column>
          <el-table-column fixed="right" label="操作" width="150">
            <template slot-scope="scope">
              <router-link :to="'/saas-clients/detail/'+scope.row.id">查看</router-link>
            </template>
          </el-table-column>
        </el-table>
      </el-card>
    </div>
  </div>
</template>

<script>
import { list, detail } from "@/api/base/saasClients";
export default {
  name: "saas-clients-table-index",
  data() {
    return {
      tableData: [],
    };
  },
  methods: {
    // 获取列表数据
    getList() {
      list().then((res) => {
        this.tableData = res.data.data;
        console.log(this.tableData)
      });
    },
    headStyle(){
      return "text-align:center";
    }
  },
  // 创建完毕状态
  created() {
    this.getList();
  },
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.alert {
  margin: 10px 0px 0px 0px;
}
.pagination {
  margin-top: 10px;
  text-align: right;
}
</style>
